By default, a single input box, regardless of the typesubmit or typebutton type of the button, returns are submitted, then how to remove the form and press enter to submit, the following is a good example. You can refer to the following
In HTML pages because of the use of the form, you often need to disable enter to submit the form. Because the content page or the master page itself has type= "submit" button, when the TextBox is focused, pressing ENTER will touch the default
Submitted in this manner, when the input value is 22222222, the URL submitted later becomes localhost:3980/input.html?name=222222Some of the notable details include:
When you set the Type=submit, the input control becomes a button with the text
Input commit behavior description for the type of submit of the same nameThis situation,
It can be used as a button for submitting content, which is sent to the parameters of the server segment, corresponding to the button
Button and submit, buttonsubmit
Submit is a special case of a button and also a kind of button. It automatically integrates the submit action.
If the form needs to be processed (including input verification) by clicking the submit button and then
Today to do the project, the project is a car wash system, swipe after the focus out of the auto-trigger return event, such as, a text box, put the focus, brush the card, the text box automatically get card number, while triggering the return event,
Button and submit, buttonsubmit
Original article from:
Http://blog.sina.com.cn/s/blog_693d183d0100uolj.html
Submit is a special case of a button and also a kind of button. It automatically integrates the submit action.
If the form needs to be
Original from:Http://blog.sina.com.cn/s/blog_693d183d0100uolj.htmlSubmit is a special case of the button and a button, which automatically integrates the commit action.If the form after the click on the Submit button need to use JS processing
When the text box gets the focus, click Enter to submit and not submit:
In some cases, for convenience, there may be such a need, that is, when the text box in the form to get focus, click Enter ENTER to achieve the form submission function, but
Type=button is simply a button function;Type=submit is to send a form; If so, can you replace button with submit?Sumit submit the form, the button needs to bind the event can not be used to submit data can not, for example, you want to implement a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.